Learn R Programming

adegenet (version 1.4-2)

genind class: adegenet formal class (S4) for individual genotypes

Description

The S4 class genind is used to store individual genotypes. It contains several components described in the 'slots' section). The summary of a genind object invisibly returns a list of component. The function .valid.genind is for internal use. The function genind creates a genind object from a valid table of alleles corresponding to the @tab slot. Note that as in other S4 classes, slots are accessed using @ instead of $.

Arguments

encoding

UTF-8

Extends

Class "gen", directly. Class "indInfo", directly.

See Also

as.genind, is.genind, genind2genpop, genpop, import2genind, read.genetix, read.genepop, read.fstat, na.replace Related classes: - genpop for storing data per populations - genlight for an efficient storage of binary SNPs genotypes

Examples

Run this code
showClass("genind")

obj <- read.genetix(system.file("files/nancycats.gtx",package="adegenet"),missing="mean")
obj
validObject(obj)
summary(obj)

# test inter-colonies structuration
if(require(hierfstat)){
gtest <- gstat.randtest(obj,nsim=99)
gtest
plot(gtest)
}

# perform a between-class PCA
pca1 <- dudi.pca(obj@tab,scannf=FALSE,scale=FALSE)
pcabet1 <- between(pca1,obj@pop,scannf=FALSE)
pcabet1

s.class(pcabet1$ls,obj@pop,sub="Inter-class PCA",possub="topleft",csub=2)
add.scatter.eig(pcabet1$eig,2,xax=1,yax=2)

Run the code above in your browser using DataLab